home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Aminet
/
comm
/
mmgr
/
MM_ReqFiles.lha
/
MM_REQFiles.Rexx_UNCMP
< prev
next >
Wrap
Text File
|
1996-08-27
|
18KB
|
418 lines
/*
$VER: MM_REQFiles V0.11 (27.08.1996)
(c) 1996 Ulrich Lammers (39:178/0.0@AmigaNet)
*/
options cache
options failat 99
options results
signal on break_c
signal on break_d
signal on break_e
signal on break_f
signal on halt
signal on ioerr
signal on syntax
if ~show('P','MAILMANAGER') then do I='| '
say 'FEHLER : Zum korrekten Ablauf dieses Skripts, muß MailManager'
say ' betriebsbereit im Speicher liegen.'
exit 0
end
else address MAILMANAGER
parse arg in.areatag in.msgnum rest
if in.areatag = '?' then do
say ''
say ' Rx MM_ReqFiles[.Rexx] [ %N %A ] '
say ''
exit
end
call Include_Lib('rexxsupport')
call Init()
call log('/')
call log('+ *** MM_ReqFiles V0.11 started *** ')
call log('| (©) 1996 Ulrich Lammers ')
call log('| ')
call log('| Read Config ... ')
call Read_Config()
call log('| ')
call log('| done...')
MM_Requester Titel 'REQ' 'GadGetUser'
If RC=1 then req.wahl = 1
If RC=2 then req.wahl = 2
If RC=3 then req.wahl = 3
End ='B9'
If RC=0 then call quit(5,'Aborted by User')
if req.wahl = 1 then do
MM_MultiselReq 'cfg.change.bbs' 'req.out' '"Please select Files to Request"' 'STR'
if RC=1 then call quit(5,'Aborted by User')
call log('| ')
if req.out.count>0 then do n=0 to req.out.count-1
parse var req.out.n out.name dummy out.file .
tmp = '"#?'out.name'#?'out.file'#?"'
MM_SearchinStem 'stem.cfgdata' 'found' tmp 'STR'
dataout = found.0
parse var dataout out.name out.file out.node out.passwd .
parse var out.node req.out.node '@' dummy
req = translate(Strip(req.out.node), '..', ':/')'.REQ'
if exists(System.Outbound||req) then req.mode = 'A'
else req.mode = 'W'
if ~open(req.wahl.file,system.outbound||req,req.mode) then Call quit(30,'Could not open 'System.Outbound||req'')
if out.passwd = NONE then call writeLN(req.wahl.file,Strip(out.file)'')
else call writeLN(req.wahl.file,Strip(out.file)' 'strip(out.passwd)'')
call close(req.wahl.file)
call log('| Reqfile.: 'substr(out.file,1,25,'.')' from.: 'req.out.node' ')
end
end
Titel_II = '" "';Text_II='Please Register MM_ReqFiles';Gad='*_Jepp|*_Noep'
if req.wahl = 2 then do
if in.areatag ='' then call quit(5,'This funktion is only in the messagemenue available')
MM_ReadMsg in.Areatag in.msgnum stem
parse var stem.FromAddr req.out.node '@' dummy
req = translate(Strip(req.out.node), '..', ':/')'.REQ'
if RC~=0 & in.msgnum = '' then call quit(30,'could not read filelist ( Msg 'in.msgnum ' in Area 'in.areatag' )')
do n=0 to stem.text.count
file = stem.text.n
MM_AddtoStem 'out.stem' 'file'
end
MM_MultiselReq 'out.stem' 'req.out' '"Please select Files to Request"' 'STR'
if RC=1 then call quit(5,'Aborted by User')
if exists(System.Outbound||req) then req.mode = 'A'
else req.mode = 'W'
if ~open(req.wahl.file,system.outbound||req,req.mode) then Call quit(30,'Could not open 'System.Outbound||req'')
call log('| ')
if req.out.count>0 then do n=0 to req.out.count-1
parse var req.out.n select.files dummy
call writeLN(req.wahl.file,Strip(select.files)'')
call log('| Reqfile.: 'substr(select.files,1,25,'.')' from.: 'req.out.node' ')
end
call close(req.wahl.file)
end
if req.wahl = 3 then do
MM_SingleSelReq 'cfg.bbs' 'out.name' '"Please select a Filelist"' 'STR'
if RC=1 then call quit(5,'Aborted by User')
bbs.name = strip(out.name.0)
tmp = '#?'bbs.name'#?'
MM_SearchinStem 'stem.data' 'found' tmp 'STR'
dataout = found.0
parse var dataout out.name out.node out.passwd out.pfad .
name = strip(out.name)
node = strip(out.node)
passwd = strip(out.passwd)
pfad = strip(out.pfad)
parse var node req.out.node '@' dummy
MM_ReadStem pfad 'stem.out.liste'
if RC~=0 then call quit(30,'could not read 'pfad'')
MM_MultiSelReq 'stem.out.liste' 'ausw' '"Please select files to request"' 'STR'
if RC=1 then call quit(5,'Aborted by User')
req = translate(req.out.node,'..',':/')'.REQ'
if exists(System.Outbound||req) then req.mode = 'A'
else req.mode = 'W'
call log('| ')
if ~open(outfiles,system.outbound||req,req.mode) then Call quit(30,'Could not open 'System.Outbound||req'')
if ausw.count>0 then do n=0 to ausw.count-1
write.files = ausw.n
parse var write.files writefiles dummy
if passwd = NONE then call writeLN(outfiles,strip(writefiles)'')
else call writeLN(outfiles,strip(writefiles)' 'passwd'')
call log('| Reqfile.: 'substr(writefiles,1,25,'.')' from.: 'req.out.node' ')
end
call close(outfiles)
end
Magna='0';Call K.Init()
if Magna = 0 then do
MM_Requester Titel_II 'Text_II' 'Gad'
If RC=1 then If exists('MM:Rexx/Reg_ReqFiles.Rexx') then
Address command 'rx MM:Rexx/Reg_ReqFiles'
else call quit(10,'Could not open MM:Rexx/Reg_ReqFiles.Rexx')
If RC=0 then Exit
end
call log('| ')
call log('+ ** MM_ReqFiles V0.11 ended ** ')
call log('\ ')
exit
Init: Procedur
show
ReQ = ' Please select a Filerequest - Mode '
Titel = '"MM_ReqFiles V0.11 (c) 1996 Ulrich Lammers"'
GadGetUser = ' _Config REQ | _Message REQ | _Filelist REQ | _Abbruch '
MM_GetCfgPaths System
MM.Loglevel = '2'
cfg.path = 'MM:Config/'
req.wahl = '9'
req.mode = 'W'
return
Log: procedure expose MM.
parse arg msglog
MM_WriteLog 'msglog' MM.LogLevel
return
Read_Config: procedur
ProgCFG = 'MM:Config/MM_REQFiles.Cfg'
MM_ReadStem ProgCFG 'cfg'
ReadCFGError=' + Unable to read MM_REQFFile.cfg !!!'
if RC~=0 then MM_Writelog 'ReadCFGError' '1'
do l=0 to cfg.count-1
parse value strip(translate(cfg.l, ' ', '9'x)) with key args ';' .
key = upper(strip(key))
args = strip(args)
select
when key='' then interate
when key='#CONFIGREQ' then do
MM_AddToStem 'stem.cfgdata' 'args'
parse var args st.cfg st.name parameter
input.cfg = substr(st.cfg' ',1,30,'.')'File.:> 'st.name
MM_AddToStem 'cfg.change.bbs' 'input.cfg'
end
when key='#FILELIST' then do
MM_AddToStem 'stem.data' 'args'
parse var args cfg.name cfg.parameter
MM_AddToStem 'cfg.bbs' 'cfg.name'
end
otherwise NOP
end
end
return
K.INIT: procedur
Magna = '0'
w.k='K';w.e='e';w.y='y'
if exists('MM:Config/MM_ReqFiles.'||w.k||w.e||w.y) then do
open(user.in,'MM:Config/MM_ReqFiles.'||w.k||w.e||w.y,'R')
If INDEX(user.in,end)>=0 then Magna = '1'
Call close(user.in)
end
return
Quit:
parse arg return_code, error_msg
error_line = 0
rc = 0
signal Exit
Syntax:
signal off syntax
return_code = 40
error_line = sigl
error_msg = 'Syntax-error' rc 'at line' sigl '['errortext(rc)']'
rc = 0
signal Exit
break_c:; break_d:; break_e:; break_f:; halt:
signal off break_c
signal off break_d
signal off break_e
signal off break_f
signal off halt
return_code = 5
error_line = 0
error_msg = 'Execution halted!!!'
rc = 0
signal Exit
Exit:
select
when return_code>=40 then error = 'INTERNAL-ERROR:'
when return_code>=30 then error = 'IO-ERROR:'
when return_code>=20 then error = 'ERROR:'
when return_code>=10 then error = 'WARNING:'
when return_code>=5 then error = 'INFO:'
otherwise error = ''
end
call Log()
call Log('***' strip(error error_msg) '***', '+')
call Log(,'\')
exit return_code
IOerr:
signal off ioerr
return_code = 20
error_line = sigl
error_msg = 'IO-error' rc 'at line' sigl '['errortext(rc)']')
rc = 0
signal Exit
Include_Lib: procedure Expose system.
parse arg lib, prio
if right(upper(lib), 8)~='.LIBRARY' then lib = lib'.library'
if prio='' then prio = 0
if ~exists('libs:'lib) then call Quit(30, '"'lib'" does not exist!')
if ~show('l', lib) then
if ~addlib(lib, prio, -30, 0) then call Quit(20, 'Could not open "'lib'"!')
return